cmake_minimum_required(VERSION 2.8.1) 
project(OmegaDoom)

find_package(SDL REQUIRED)
find_package(SDL_mixer REQUIRED)
find_package(SDL_net REQUIRED)

include(../../trunk/CMakeModules/FindOmegalib.cmake)

set (SOURCES
	src/am_map.c
	src/am_map.h
	src/d_client.c
	src/d_deh.c
	src/d_deh.h
	src/d_englsh.h
	src/d_event.h
	src/d_items.c
	src/d_items.h
	src/d_main.c
	src/d_main.h
	src/d_net.h
	src/d_player.h
	src/d_think.h
	src/d_ticcmd.h
	src/doomdata.h
	src/doomdef.c
	src/doomdef.h
	src/doomstat.c
	src/doomstat.h
	src/doomtype.h
	src/dstrings.c
	src/dstrings.h
	src/f_finale.c
	src/f_finale.h
	src/f_wipe.c
	src/f_wipe.h
	src/g_game.c
	src/g_game.h
	src/hu_lib.c
	src/hu_lib.h
	src/hu_stuff.c
	src/hu_stuff.h
	src/i_joy.h
	src/i_main.h
	src/i_network.h
	src/i_sound.h
	src/i_system.h
	src/i_video.h
	src/info.c
	src/info.h
	src/lprintf.c
	src/lprintf.h
	src/m_argv.c
	src/m_argv.h
	src/m_bbox.c
	src/m_bbox.h
	src/m_cheat.c
	src/m_cheat.h
	src/m_fixed.h
	src/m_menu.c
	src/m_menu.h
	src/m_misc.c
	src/m_misc.h
	src/m_random.c
	src/m_random.h
	src/m_swap.h
	src/md5.c
	src/md5.h
	src/mmus2mid.h
	src/mmus2mid.c
	src/p_ceilng.c
	src/p_checksum.c
	src/p_checksum.h
	src/p_doors.c
	src/p_enemy.c
	src/p_floor.c
	src/p_genlin.c
	src/p_inter.c
	src/p_inter.h
	src/p_lights.c
	src/p_map.c
	src/p_map.h
	src/p_maputl.c
	src/p_maputl.h
	src/p_mobj.c
	src/p_mobj.h
	src/p_plats.c
	src/p_pspr.c
	src/p_pspr.h
	src/p_saveg.c
	src/p_saveg.h
	src/p_setup.c
	src/p_setup.h
	src/p_sight.c
	src/p_spec.c
	src/p_spec.h
	src/p_switch.c
	src/p_telept.c
	src/p_tick.c
	src/p_tick.h
	src/p_user.c
	src/p_user.h
	src/protocol.h
	src/r_bsp.c
	src/r_bsp.h
	src/r_data.c
	src/r_data.h
	src/r_defs.h
	src/r_demo.c
	src/r_demo.h
	src/r_draw.c
	src/r_draw.h
	src/r_drawcolumn.inl
	src/r_drawspan.inl
	src/r_filter.c
	src/r_filter.h
	src/r_fps.c
	src/r_fps.h
	src/r_main.c
	src/r_main.h
	src/r_patch.c
	src/r_patch.h
	src/r_plane.c
	src/r_plane.h
	src/r_segs.c
	src/r_segs.h
	src/r_sky.c
	src/r_sky.h
	src/r_state.h
	src/r_things.c
	src/r_things.h
	src/s_sound.c
	src/s_sound.h
	src/sounds.c
	src/sounds.h
	src/st_lib.c
	src/st_lib.h
	src/st_stuff.c
	src/st_stuff.h
	src/tables.c
	src/tables.h
	src/v_video.c
	src/v_video.h
	src/version.c
	src/version.h
	src/w_mmap.c
	src/w_wad.c
	src/w_wad.h
	src/wi_stuff.c
	src/wi_stuff.h
	src/z_bmalloc.c
	src/z_bmalloc.h
	src/z_zone.c
	src/z_zone.h
	src/gl_intern.h
	src/gl_main.c
	src/gl_struct.h
	src/gl_texture.c
	src/OMEGA/i_main.c
	src/OMEGA/i_system.c
	src/OMEGA/i_video.c
	src/OMEGA/i_pngshot.c
	src/OMEGA/i_pngshot.h
	src/OMEGA/i_sound.c
	src/OMEGA/i_network.c
	src/OMEGA/i_joy.c
	src/OMEGA/OMEGA_main.cpp
	src/OMEGA/OMEGA_interface.cpp
	src/OMEGA/OMEGA_interface.h)
	
if(WIN32)
	include_directories(./src/WIN)
else(WIN32)
	include_directories(./src/POSIX)
	add_definitions(-D_GNU_SOURCE)
endif(WIN32)
	
add_executable(omegadoom ${SOURCES})

add_definitions(-DGL_DOOM -DHAVE_CONFIG_H -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
include_directories(${SDLNET_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR} ${OMEGA_INCLUDE_DIRS} ./src ./src/OMEGA)
target_link_libraries(omegadoom ${SDL_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLNET_LIBRARY} ${OMEGA_LIB})
